using System;

namespace Dairy_Town.Elm327.Core.ObdModes
{
    /// <summary>
    /// Contains methods and properties for retrieving generic
    /// OBD mode 14 PIDs specific to Ford Motor Company.
    /// </summary>
    public class ObdFordMode14 : AbstractObdMode
    {
        #region Constructors

        /// <summary>
        /// Creates an instance of <see cref="ObdGenericMode09"/>.
        /// </summary>
        /// <param name="elm">A reference to the ELM327 driver.</param>
        internal ObdFordMode14(ElmDriver elm)
            : base(elm, "14")
        {
        }

        #endregion

        #region Public Instance Properties

        public bool SeatbeltFastened
        {
            get
            {
                string[] reading = this.GetPidResponse("27");

                if (reading.Length > 0)
                {
                    string value = reading[0];

                    if (value == "1")
                        return true;

                    return false;
                }
                else
                {
                    return false;
                }
            }
        }

        #endregion
    }
}
